using UnityEngine;

public class CameraController : MonoBehaviour
{
    [Header("跟随目标")]
    public Transform followTarget;
    [Header("跟随缓动幅度")]
    public float followSmoothRate = 10f;
    private void LateUpdate()
    {
        var curPos = transform.position;
        var targetPos =  new Vector3(followTarget.position.x, followTarget.position.y, curPos.z);
        transform.position = Vector3.Lerp(curPos, targetPos, followSmoothRate * Time.deltaTime);
    }
}
